package com.frame.pageform.tag;

import com.frame.util.DataConvert;

/**
 * @Title: 系统
 * @Description:
 * @Copyright: Copyright (c) 2015
 * @Company:
 * @author 王海锋
 * @CreatedTime:2015-7-14 下午10:28:16
 * @version 1.0
 */

public class IfTag extends BaseTag{

    private String bind;

    public String getBind() {
        return bind;
    }
    public void setBind(String bind) {
        this.bind = bind;
    }
    @Override
    public int start() throws Exception {
        // TODO Auto-generated method stub
        boolean bl=false;

        Object obj=executeExpression(bind.replaceAll("'", "\""));
        if(obj==null)
            bl=false;
        if(obj instanceof Boolean)
            bl=((Boolean)obj).booleanValue();
        else
            throw new Exception("bind表达式不是判断语句");

        return bl?EVAL_BODY_INCLUDE:SKIP_BODY;
    }

}
